package com.example.lxc415billiards.service.impl;

import com.example.lxc415billiards.domain.BilliardCue;
import com.example.lxc415billiards.mapper.BilliardCueMapper;
import com.example.lxc415billiards.service.BilliardCueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BilliardCueServiceImpl implements BilliardCueService {

    @Autowired
    private BilliardCueMapper billiardCueMapper;

    @Override
    public List<BilliardCue> getAllCues() {
        return billiardCueMapper.selectAllCues();
    }

    @Override
    public BilliardCue getCueById(int cueId) {
        return billiardCueMapper.selectCueById(cueId);
    }

    @Override
    public BilliardCue addCue(BilliardCue cue) {
        billiardCueMapper.insertCue(cue);
        return cue;
    }

    @Override
    public void deleteCueById(int cueId) {
        billiardCueMapper.deleteCueById(cueId);
    }

    @Override
    public BilliardCue updateCue(BilliardCue cue) {
        billiardCueMapper.updateCue(cue);
        return cue;
    }
}
